//
//  Dog.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Dog.h"

@implementation Dog

-(id)init
{
    
    _name = @"大黄";
    _color = @"yellow";
    [self info];
    return self;
    
}

-(void)info
{
    
    NSLog(@"%@ %@", _name, _color);
    
}

-(void)eat
{
    
    NSLog(@"%@色的%@正在吃饭", _color, _name);
    
}

-(id)initWithName:(NSString *)name color:(NSString *)color
{
    
    _name = name;
    _color = color;
    return self;
}


-(NSString *)name
{
    return _name;
}

-(void)setName:(NSString *)name
{
    _name = name;
}
-(NSString *)color
{
    return _color;
}
-(void)setColor:(NSString *)color
{
    _color = color;
}

+ (id)dogWithName:(NSString *)name color:(NSString *)color
{
    Dog *d = [[Dog alloc] initWithName:name color:color];
    return d;
}


@end
